//
//  GameController.h
//  NuevoMundo
//
//  Created by Bob Rosset on 11/21/10.
//  Copyright 2010 Bob Rosset. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "Unit.h"
#import "PopUp.h"
#import "Map.h"
/*** UNITS ***/
#import "Galleon.h"
#import "Privateer.h"
#import "Lumberjack.h"
#import "Soldier.h"
/*** UNITS ***/

@interface GameController : CCLayer {
	int squareSize;
	int mapWidth;
	int mapHeight;
	
	CCSprite* miniMap;
	CCSprite* mainFrame;
	CCSprite* mapBackground;
	CCSprite* displayUnit;
	
	Map* worldMap;
	CGPoint dragTouchPosition;
	
	CCLabelTTF* countryLabel;
	CCLabelTTF* seasonLabel;
	CCLabelTTF* moneyLabel;
	CCLabelTTF* taxLabel;
	CCLabelTTF* unitTypeLabel;
	CCLabelTTF* movesLabel;
	CCLabelTTF* orderLabel;
	CCLabelTTF* endTurnLabel;
	
	CCActionInterval* endTurnAction;
	
	int faction;
	int year;
	int season;
	
	Unit* currentUnit;
	PopUp* popup;
	
	NSMutableArray* userUnits;
	NSMutableArray* movementArray;
	
	BOOL shouldMoveCurrentUnit;
	BOOL endTurn;
	BOOL hidePopUp;
}

+(id) scene;
+(GameController*)sharedInstance;
-(id) init;
-(void) createInitialUnits;
-(void)showEndTurn;
-(void)endTurn;
-(void)checkCollision:(Unit*)_unit;
-(void)setSelected:(Unit*)_unit;
-(void)unselect;
-(void)moveCurrentUnit;
-(void)updateCurrentShowedInfo;
-(NSString*)getSeason;
-(NSString*)getOrder:(int)_order;
-(void)checkBounds;
-(void)drawSquare;
-(void)showMultipleUnits;
-(void)displayPopUp:(BOOL)_display;
-(BOOL)ccTouchesBegan:(NSSet*)touches withEvent:(UIEvent*)event;
-(BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
-(BOOL)ccTouchesEnded:(NSSet*)touches withEvent:(UIEvent*)event;

@end
